package gui;

import java.awt.Component;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * panel for entering information which pertains specifically to students
 * applying for loans
 * 
 * @author gke703
 */
public class StudentInfoPanel extends JPanel {

	/** text form for entering name of attended university */
	protected ValueEntryPanel collegeField;

	/** check box to verify citizenship */
	protected JCheckBox citizenCheck;

	/** combo box for checking user marital status */
	protected ValueSelectMenu maritalBox;

	/** combo box for checking user's father's education level */
	protected ValueSelectMenu fatherBox;

	/** combo box for checking user's mother's education level */
	protected ValueSelectMenu motherBox;

	/** text form for entry of user sin number */
	protected ValueEntryPanel sinField;

	/**
	 * displays forms and prompts pertaining to student information
	 */
	public StudentInfoPanel() {
		setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));

		// add a label with a prompt to enter the new Student Data
		JLabel prompt = new JLabel("Additional Information");
		prompt.setMaximumSize(prompt.getPreferredSize());
		add(prompt);
		// prompt.setAlignmentY(Component.LEFT_ALIGNMENT);
		prompt.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's academy
		collegeField = new ValueEntryPanel("College:");
		add(collegeField);
		// textField.setMaximumSize(textField.getPreferredSize());
		// textField.setAlignmentX(Component.CENTER_ALIGNMENT);
		collegeField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a check box to indicate whether applicant is a Canadian Citizen
		// or not
		citizenCheck = new JCheckBox("Canadian Citizen");
		add(citizenCheck);
		citizenCheck.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a label and combo box for marital status
		final String[] m = { "Single", "Married", "CommonLaw" };
		maritalBox = new ValueSelectMenu("Marital Status:", m);
		add(maritalBox);
		maritalBox.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a label and combo box for Father's education status
		final String[] e1 = { "Degree", "Diploma", "High School", "None" };
		fatherBox = new ValueSelectMenu("Father's education:", e1);
		add(fatherBox);
		fatherBox.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a label and combo box for mother's education status
		motherBox = new ValueSelectMenu("Mother's education:", e1);
		add(motherBox);
		motherBox.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());

		// add a txtbox with the field for the entry of the student's social
		// insurance number
		sinField = new ValueEntryPanel("SIN:");
		add(sinField);
		// birthdateField.setMaximumSize(birthdateField.getPreferredSize());
		add(sinField);
		sinField.setAlignmentX(Component.LEFT_ALIGNMENT);
		add(Box.createVerticalGlue());
	}

	private static final long serialVersionUID = 1L;

}
